<template>

    <div class="user">
      <div class="common-content">
        <!--内容-->
        <div class="product-content">
          <div class="table-wrap">
            <el-table size="small" :data="tableData" border style="width: 100%" v-loading="loading">
              <el-table-column align="center" min-width="200" prop="feedback_content" label="反馈内容"></el-table-column>
              <el-table-column align="center" min-width="100" prop="phone_number" label="手机号 "></el-table-column>
              <el-table-column align="center" min-width="100" prop="user_name" label="姓名"></el-table-column>
              <el-table-column align="center" min-width="140" prop="create_time" label="反馈时间"></el-table-column>
            </el-table>
          </div>
  
          <!--分页-->
          <div class="pagination">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background
              :current-page="curPage" :page-size="pageSize" layout="total, prev, pager, next, jumper"
              :total="totalDataNumber"></el-pagination>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import FeedbackApi from '@/api/feedback.js';
  export default {
    inject: ['reload'],
    data() {
      return {
        /*是否加载完成*/
        loading: true,
        /*列表数据*/
        tableData: [],
        /*一页多少条*/
        pageSize: 10,
        /*一共多少条数据*/
        totalDataNumber: 0,
        /*当前是第几页*/
        curPage: 1,
        /*横向表单数据模型*/
        formInline: {
          user: '',
          region: ''
        },
        /*是否打开添加弹窗*/
        open_add: false,
        /*是否打开编辑弹窗*/
        open_edit: false,
        /*当前编辑的对象*/
        curModel: {},
        /*角色列表*/
        roleList: [],
      };
    },
    created() {
      /*获取列表*/
      this.getTableList();
    },
    methods: {
      /*搜索查询*/
      onSubmit() {
          this.curPage = 1;
          this.getTableList();
        },
      /*选择第几页*/
      handleCurrentChange(val) {
        let self = this;
        self.curPage = val;
        self.loading = true;
        self.getTableList();
      },
  
      /*每页多少条*/
      handleSizeChange(val) {
        this.curPage = 1;
        this.pageSize = val;
        this.getTableList();
      },
  
      /*获取列表*/
      getTableList() {
        let self = this;
        let Params = {};
        Params.page = self.curPage;
        Params.list_rows = self.pageSize;
        FeedbackApi.getFeedbackList(Params, true)
          .then(data => {
            self.loading = false;
            self.tableData = data.data.data;
            self.totalDataNumber = data.data.total;
          })
          .catch(error => { });
      },
    }
  };
  </script>
  
  <style></style>
  